import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '用户id',
    align:"center",
    dataIndex: 'userId'
   },
   {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '文章内容',
    align:"center",
    dataIndex: 'content'
   },
   {
    title: '文章摘要',
    align:"center",
    dataIndex: 'summary'
   },
   {
    title: '所属分类id，一个文章一个分类',
    align:"center",
    dataIndex: 'categoryId_dictText'
   },
   {
    title: '内容图',
    align:"center",
    dataIndex: 'coverImg'
   },
   {
    title: '封面图',
    align:"center",
    dataIndex: 'topImg'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户id',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '文章内容',
    field: 'content',
    component: 'InputTextArea',
  },
  {
    label: '文章摘要',
    field: 'summary',
    component: 'Input',
  },
  {
    label: '所属分类id，一个文章一个分类',
    field: 'categoryId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"blog_category,id,id"
     },
  },
  {
    label: '内容图',
    field: 'coverImg',
    component: 'Input',
  },
  {
    label: '封面图',
    field: 'topImg',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
